﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters.WaterReadingChangeMeassure.Search
{
    public class PresenterSearchKardexMeasure
    {
        ISearchKardexMeasureView view;
        public PresenterSearchKardexMeasure(ISearchKardexMeasureView view)
        {
            this.view = view;
        }

        public void SearchByAllParameters()
        {
            try
            {
                Model.KardexHelper kardexHelper = new Model.KardexHelper() { Name = view.Name, LastName = view.LastName, Allotment = view.Allotment, Square = view.Square };
                view.kardexList = ManagerKardex.SearchKardexByParameter(kardexHelper);
            }
            catch (Exception ex)
            {
                view.kardexList = null;
                view.NotifyErrorMessage(ex.Message);
            }
        }

    }
}
